module.exports = async function dateReplace(date,res) {
    if(date.indexOf('T') !== -1 || date.indexOf('Z') !== -1 ){
        //T在Z不在，或者Z在T不在，或者T和Z都在
        if(date.indexOf('T') !== -1 && date.indexOf('Z') !== -1 ){
            //T和Z都在
            date = date.replace('T',' ').replace('Z',' ')
            return date
        }else if(date.indexOf('T') !== -1 && date.indexOf('Z') === -1 ){
            date = date.replace('T',' ')
            return date
        }else if(date.indexOf('T') === -1 && date.indexOf('Z') !== -1 ){
            date = date.replace('Z',' ')
            return date
        }
        else{
            return res.send({
                code: 1,
                msg: '请填选正确日期格式'
            })
        }
    }
    else if(date.indexOf('T') === -1 && date.indexOf('Z') === -1 ){
        return date
    }
}

